home *** CD-ROM | disk | FTP | other *** search
-
-
-
- tmpnam C Library Procedures tmpnam
-
-
-
- _________________________________________________________________
-
- NNAAMMEE
- tmpnam, tempnam - Generate unique names for temporary files
-
- SSYYNNOOPPSSIISS
- iinncclluuddee <<ssttddiioo..hh>>
-
- cchhaarr **
- ttmmppnnaamm((_s)
-
- cchhaarr **
- tteemmppnnaamm((_d_i_r, _p_r_e_f_i_x)
-
- AARRGGUUMMEENNTTSS
- char *_s _i_n/_o_u_t Place to store temporary file
- name. If NNUULLLL, store name in
- local static storage that will be
- overwritten on next call to
- ttmmppnnaamm. If not NNUULLLL, _s must
- point to a buffer containing at
- least LL__ttmmppnnaamm bytes.
-
- char *_d_i_r _i_n Directory in which to temporary
- file should reside. If NNUULLLL, or
- if _d_i_r is not an accessible
- directory, defaults to PP__ttmmppddiirr.
-
- char *_p_r_e_f_i_x (in) First few letters to use for name
- of temporary file.
-
- _________________________________________________________________
-
-
- DDEESSCCRRIIPPTTIIOONN
- The procedures ttmmppnnaamm and tteemmppnnaamm generate unique file names
- suitable for temporary files. Each procedure returns a
- pointer to the name it generated, except that under some
- conditions (such as inability to allocate memory, for exam-
- ple) tteemmppnnaamm will fail to generate a file name. When this
- happens, tteemmppnnaamm will return NNUULLLL.
-
- TTmmppnnaamm generates file names that refer to a standard direc-
- tory defined by PP__ttmmppddiirr (currently //uussrr//ttmmpp). Each time
- ttmmppnnaamm is called it will return a different file name, which
- does not refer to any existing file.
-
- TTeemmppnnaamm is similar to ttmmppnnaamm except that it provides more
- flexibility. The _d_i_r argument may be used to specify a par-
- ticular directory to which the generated name should refer.
- If this is not an accessible directory, then PP__ttmmppddiirr will
- be used. If this directory is not accessible either, then
- //ttmmpp will be used as a last resort. If the TTMMPPDDIIRR environ-
- ment variable is defined and refers to an accessible
-
-
-
- Sprite v.1.0 Printed: October 3, 1989 1
-
-
-
-
-
-
- tmpnam C Library Procedures tmpnam
-
-
-
- directory, then it will override any of the above choices.
-
- The _p_r_e_f_i_x argument may be used to specify the first few
- letters of the last component of the path name generated by
- tteemmppnnaamm. TTeemmppnnaamm dynamically allocates space for the name
- using mmaalllloocc. It is the responsibility of the caller to
- release this storage by passing the returned string to ffrreeee
- when it is no longer needed.
-
- KKEEYYWWOORRDDSS
- file name, temporary, unique
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v.1.0 Printed: October 3, 1989 2
-
-
-
-